home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_16247.txt < prev    next >
Text File  |  1989-02-26  |  696b  |  31 lines

  1. -- card: 16247 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2202
  5. -- name: NumberofChars
  6.  
  7.  
  8. -- part contents for background part 10
  9. ----- text -----
  10. 3
  11.  
  12. -- part contents for background part 2
  13. ----- text -----
  14. --
  15. -- NumberOfChars -- utility function that tells you how many times a
  16. -- character turns up in a string
  17. --
  18. function NumberOfChars theChar, theString
  19.   put 0 into charCount
  20.   put first character of theChar into theChar -- strip
  21.   repeat with i = 1 to the length of theString
  22.     if character i of theString is theChar then add 1 to charCount
  23.   end repeat
  24.   return charCount
  25. end NumberOfChars
  26.  
  27.  
  28.  
  29. -- part contents for background part 3
  30. ----- text -----
  31. NumberofChars